3.348 \(\int \frac{\log ^2(c (a+b x)^n)}{d+e x+f x^2} \, dx\)

Optimal. Leaf size=372 \[ \frac{2 n \log \left (c (a+b x)^n\right ) \text{PolyLog}\left (2,\frac{2 f (a+b x)}{2 a f-b \left (e-\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}-\frac{2 n \log \left (c (a+b x)^n\right ) \text{PolyLog}\left (2,\frac{2 f (a+b x)}{2 a f-b \left (\sqrt{e^2-4 d f}+e\right )}\right )}{\sqrt{e^2-4 d f}}-\frac{2 n^2 \text{PolyLog}\left (3,\frac{2 f (a+b x)}{2 a f-b \left (e-\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}+\frac{2 n^2 \text{PolyLog}\left (3,\frac{2 f (a+b x)}{2 a f-b \left (\sqrt{e^2-4 d f}+e\right )}\right )}{\sqrt{e^2-4 d f}}+\frac{\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac{b \left (-\sqrt{e^2-4 d f}+e+2 f x\right )}{2 a f-b \left (e-\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}-\frac{\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac{b \left (\sqrt{e^2-4 d f}+e+2 f x\right )}{2 a f-b \left (\sqrt{e^2-4 d f}+e\right )}\right )}{\sqrt{e^2-4 d f}} \]

[Out]

(Log[c*(a + b*x)^n]^2*Log[-((b*(e - Sqrt[e^2 - 4*d*f] + 2*f*x))/(2*a*f - b*(e - Sqrt[e^2 - 4*d*f])))])/Sqrt[e^
2 - 4*d*f] - (Log[c*(a + b*x)^n]^2*Log[-((b*(e + Sqrt[e^2 - 4*d*f] + 2*f*x))/(2*a*f - b*(e + Sqrt[e^2 - 4*d*f]
)))])/Sqrt[e^2 - 4*d*f] + (2*n*Log[c*(a + b*x)^n]*PolyLog[2, (2*f*(a + b*x))/(2*a*f - b*(e - Sqrt[e^2 - 4*d*f]
))])/Sqrt[e^2 - 4*d*f] - (2*n*Log[c*(a + b*x)^n]*PolyLog[2, (2*f*(a + b*x))/(2*a*f - b*(e + Sqrt[e^2 - 4*d*f])
)])/Sqrt[e^2 - 4*d*f] - (2*n^2*PolyLog[3, (2*f*(a + b*x))/(2*a*f - b*(e - Sqrt[e^2 - 4*d*f]))])/Sqrt[e^2 - 4*d
*f] + (2*n^2*PolyLog[3, (2*f*(a + b*x))/(2*a*f - b*(e + Sqrt[e^2 - 4*d*f]))])/Sqrt[e^2 - 4*d*f]

________________________________________________________________________________________

Rubi [A]  time = 0.405532, antiderivative size = 372, normalized size of antiderivative = 1., number of steps used = 10, number of rules used = 5, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {2418, 2396, 2433, 2374, 6589} \[ \frac{2 n \log \left (c (a+b x)^n\right ) \text{PolyLog}\left (2,\frac{2 f (a+b x)}{2 a f-b \left (e-\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}-\frac{2 n \log \left (c (a+b x)^n\right ) \text{PolyLog}\left (2,\frac{2 f (a+b x)}{2 a f-b \left (\sqrt{e^2-4 d f}+e\right )}\right )}{\sqrt{e^2-4 d f}}-\frac{2 n^2 \text{PolyLog}\left (3,\frac{2 f (a+b x)}{2 a f-b \left (e-\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}+\frac{2 n^2 \text{PolyLog}\left (3,\frac{2 f (a+b x)}{2 a f-b \left (\sqrt{e^2-4 d f}+e\right )}\right )}{\sqrt{e^2-4 d f}}+\frac{\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac{b \left (-\sqrt{e^2-4 d f}+e+2 f x\right )}{2 a f-b \left (e-\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}-\frac{\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac{b \left (\sqrt{e^2-4 d f}+e+2 f x\right )}{2 a f-b \left (\sqrt{e^2-4 d f}+e\right )}\right )}{\sqrt{e^2-4 d f}} \]

Antiderivative was successfully verified.

[In]

Int[Log[c*(a + b*x)^n]^2/(d + e*x + f*x^2),x]

[Out]

(Log[c*(a + b*x)^n]^2*Log[-((b*(e - Sqrt[e^2 - 4*d*f] + 2*f*x))/(2*a*f - b*(e - Sqrt[e^2 - 4*d*f])))])/Sqrt[e^
2 - 4*d*f] - (Log[c*(a + b*x)^n]^2*Log[-((b*(e + Sqrt[e^2 - 4*d*f] + 2*f*x))/(2*a*f - b*(e + Sqrt[e^2 - 4*d*f]
)))])/Sqrt[e^2 - 4*d*f] + (2*n*Log[c*(a + b*x)^n]*PolyLog[2, (2*f*(a + b*x))/(2*a*f - b*(e - Sqrt[e^2 - 4*d*f]
))])/Sqrt[e^2 - 4*d*f] - (2*n*Log[c*(a + b*x)^n]*PolyLog[2, (2*f*(a + b*x))/(2*a*f - b*(e + Sqrt[e^2 - 4*d*f])
)])/Sqrt[e^2 - 4*d*f] - (2*n^2*PolyLog[3, (2*f*(a + b*x))/(2*a*f - b*(e - Sqrt[e^2 - 4*d*f]))])/Sqrt[e^2 - 4*d
*f] + (2*n^2*PolyLog[3, (2*f*(a + b*x))/(2*a*f - b*(e + Sqrt[e^2 - 4*d*f]))])/Sqrt[e^2 - 4*d*f]

Rule 2418

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{u = ExpandIntegrand[
(a + b*Log[c*(d + e*x)^n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d, e, n}, x] && RationalFunct
ionQ[RFx, x] && IntegerQ[p]

Rule 2396

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_)/((f_.) + (g_.)*(x_)), x_Symbol] :> Simp[(Log[(e*
(f + g*x))/(e*f - d*g)]*(a + b*Log[c*(d + e*x)^n])^p)/g, x] - Dist[(b*e*n*p)/g, Int[(Log[(e*(f + g*x))/(e*f -
d*g)]*(a + b*Log[c*(d + e*x)^n])^(p - 1))/(d + e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p}, x] && NeQ[e*
f - d*g, 0] && IGtQ[p, 1]

Rule 2433

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + Log[(h_.)*((i_.) + (j_.)*(x_))^(m_.)]*
(g_.))*((k_.) + (l_.)*(x_))^(r_.), x_Symbol] :> Dist[1/e, Subst[Int[((k*x)/d)^r*(a + b*Log[c*x^n])^p*(f + g*Lo
g[h*((e*i - d*j)/e + (j*x)/e)^m]), x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, h, i, j, k, l, n, p, r},
 x] && EqQ[e*k - d*l, 0]

Rule 2374

Int[(Log[(d_.)*((e_) + (f_.)*(x_)^(m_.))]*((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.))/(x_), x_Symbol] :> -Sim
p[(PolyLog[2, -(d*f*x^m)]*(a + b*Log[c*x^n])^p)/m, x] + Dist[(b*n*p)/m, Int[(PolyLog[2, -(d*f*x^m)]*(a + b*Log
[c*x^n])^(p - 1))/x, x], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IGtQ[p, 0] && EqQ[d*e, 1]

Rule 6589

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]

Rubi steps

\begin{align*} \int \frac{\log ^2\left (c (a+b x)^n\right )}{d+e x+f x^2} \, dx &=\int \left (\frac{2 f \log ^2\left (c (a+b x)^n\right )}{\sqrt{e^2-4 d f} \left (e-\sqrt{e^2-4 d f}+2 f x\right )}-\frac{2 f \log ^2\left (c (a+b x)^n\right )}{\sqrt{e^2-4 d f} \left (e+\sqrt{e^2-4 d f}+2 f x\right )}\right ) \, dx\\ &=\frac{(2 f) \int \frac{\log ^2\left (c (a+b x)^n\right )}{e-\sqrt{e^2-4 d f}+2 f x} \, dx}{\sqrt{e^2-4 d f}}-\frac{(2 f) \int \frac{\log ^2\left (c (a+b x)^n\right )}{e+\sqrt{e^2-4 d f}+2 f x} \, dx}{\sqrt{e^2-4 d f}}\\ &=\frac{\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac{b \left (e-\sqrt{e^2-4 d f}+2 f x\right )}{2 a f-b \left (e-\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}-\frac{\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac{b \left (e+\sqrt{e^2-4 d f}+2 f x\right )}{2 a f-b \left (e+\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}-\frac{(2 b n) \int \frac{\log \left (c (a+b x)^n\right ) \log \left (\frac{b \left (e-\sqrt{e^2-4 d f}+2 f x\right )}{-2 a f+b \left (e-\sqrt{e^2-4 d f}\right )}\right )}{a+b x} \, dx}{\sqrt{e^2-4 d f}}+\frac{(2 b n) \int \frac{\log \left (c (a+b x)^n\right ) \log \left (\frac{b \left (e+\sqrt{e^2-4 d f}+2 f x\right )}{-2 a f+b \left (e+\sqrt{e^2-4 d f}\right )}\right )}{a+b x} \, dx}{\sqrt{e^2-4 d f}}\\ &=\frac{\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac{b \left (e-\sqrt{e^2-4 d f}+2 f x\right )}{2 a f-b \left (e-\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}-\frac{\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac{b \left (e+\sqrt{e^2-4 d f}+2 f x\right )}{2 a f-b \left (e+\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}-\frac{(2 n) \operatorname{Subst}\left (\int \frac{\log \left (c x^n\right ) \log \left (\frac{b \left (\frac{-2 a f+b \left (e-\sqrt{e^2-4 d f}\right )}{b}+\frac{2 f x}{b}\right )}{-2 a f+b \left (e-\sqrt{e^2-4 d f}\right )}\right )}{x} \, dx,x,a+b x\right )}{\sqrt{e^2-4 d f}}+\frac{(2 n) \operatorname{Subst}\left (\int \frac{\log \left (c x^n\right ) \log \left (\frac{b \left (\frac{-2 a f+b \left (e+\sqrt{e^2-4 d f}\right )}{b}+\frac{2 f x}{b}\right )}{-2 a f+b \left (e+\sqrt{e^2-4 d f}\right )}\right )}{x} \, dx,x,a+b x\right )}{\sqrt{e^2-4 d f}}\\ &=\frac{\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac{b \left (e-\sqrt{e^2-4 d f}+2 f x\right )}{2 a f-b \left (e-\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}-\frac{\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac{b \left (e+\sqrt{e^2-4 d f}+2 f x\right )}{2 a f-b \left (e+\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}+\frac{2 n \log \left (c (a+b x)^n\right ) \text{Li}_2\left (\frac{2 f (a+b x)}{2 a f-b \left (e-\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}-\frac{2 n \log \left (c (a+b x)^n\right ) \text{Li}_2\left (\frac{2 f (a+b x)}{2 a f-b \left (e+\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}-\frac{\left (2 n^2\right ) \operatorname{Subst}\left (\int \frac{\text{Li}_2\left (-\frac{2 f x}{-2 a f+b \left (e-\sqrt{e^2-4 d f}\right )}\right )}{x} \, dx,x,a+b x\right )}{\sqrt{e^2-4 d f}}+\frac{\left (2 n^2\right ) \operatorname{Subst}\left (\int \frac{\text{Li}_2\left (-\frac{2 f x}{-2 a f+b \left (e+\sqrt{e^2-4 d f}\right )}\right )}{x} \, dx,x,a+b x\right )}{\sqrt{e^2-4 d f}}\\ &=\frac{\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac{b \left (e-\sqrt{e^2-4 d f}+2 f x\right )}{2 a f-b \left (e-\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}-\frac{\log ^2\left (c (a+b x)^n\right ) \log \left (-\frac{b \left (e+\sqrt{e^2-4 d f}+2 f x\right )}{2 a f-b \left (e+\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}+\frac{2 n \log \left (c (a+b x)^n\right ) \text{Li}_2\left (\frac{2 f (a+b x)}{2 a f-b \left (e-\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}-\frac{2 n \log \left (c (a+b x)^n\right ) \text{Li}_2\left (\frac{2 f (a+b x)}{2 a f-b \left (e+\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}-\frac{2 n^2 \text{Li}_3\left (\frac{2 f (a+b x)}{2 a f-b \left (e-\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}+\frac{2 n^2 \text{Li}_3\left (\frac{2 f (a+b x)}{2 a f-b \left (e+\sqrt{e^2-4 d f}\right )}\right )}{\sqrt{e^2-4 d f}}\\ \end{align*}

Mathematica [A]  time = 0.414415, size = 655, normalized size = 1.76 \[ \frac{2 n \sqrt{4 d f-e^2} \log \left (c (a+b x)^n\right ) \text{PolyLog}\left (2,\frac{2 f (a+b x)}{2 a f+b \left (\sqrt{e^2-4 d f}-e\right )}\right )-2 n \sqrt{4 d f-e^2} \log \left (c (a+b x)^n\right ) \text{PolyLog}\left (2,\frac{2 f (a+b x)}{2 a f-b \left (\sqrt{e^2-4 d f}+e\right )}\right )-2 n^2 \sqrt{4 d f-e^2} \text{PolyLog}\left (3,\frac{2 f (a+b x)}{2 a f+b \sqrt{e^2-4 d f}+b (-e)}\right )+2 n^2 \sqrt{4 d f-e^2} \text{PolyLog}\left (3,\frac{2 f (a+b x)}{2 a f-b \left (\sqrt{e^2-4 d f}+e\right )}\right )+2 n \sqrt{4 d f-e^2} \log (a+b x) \log \left (c (a+b x)^n\right ) \log \left (1-\frac{2 f (a+b x)}{2 a f+b \sqrt{e^2-4 d f}+b (-e)}\right )-2 n \sqrt{4 d f-e^2} \log (a+b x) \log \left (c (a+b x)^n\right ) \log \left (\frac{2 f (a+b x)}{b \left (\sqrt{e^2-4 d f}+e\right )-2 a f}+1\right )+2 \sqrt{e^2-4 d f} \tan ^{-1}\left (\frac{e+2 f x}{\sqrt{4 d f-e^2}}\right ) \log ^2\left (c (a+b x)^n\right )-4 n \sqrt{e^2-4 d f} \log (a+b x) \tan ^{-1}\left (\frac{e+2 f x}{\sqrt{4 d f-e^2}}\right ) \log \left (c (a+b x)^n\right )-n^2 \sqrt{4 d f-e^2} \log ^2(a+b x) \log \left (1-\frac{2 f (a+b x)}{2 a f+b \sqrt{e^2-4 d f}+b (-e)}\right )+n^2 \sqrt{4 d f-e^2} \log ^2(a+b x) \log \left (\frac{2 f (a+b x)}{b \left (\sqrt{e^2-4 d f}+e\right )-2 a f}+1\right )+2 n^2 \sqrt{e^2-4 d f} \log ^2(a+b x) \tan ^{-1}\left (\frac{e+2 f x}{\sqrt{4 d f-e^2}}\right )}{\sqrt{-\left (e^2-4 d f\right )^2}} \]

Antiderivative was successfully verified.

[In]

Integrate[Log[c*(a + b*x)^n]^2/(d + e*x + f*x^2),x]

[Out]

(2*Sqrt[e^2 - 4*d*f]*n^2*ArcTan[(e + 2*f*x)/Sqrt[-e^2 + 4*d*f]]*Log[a + b*x]^2 - 4*Sqrt[e^2 - 4*d*f]*n*ArcTan[
(e + 2*f*x)/Sqrt[-e^2 + 4*d*f]]*Log[a + b*x]*Log[c*(a + b*x)^n] + 2*Sqrt[e^2 - 4*d*f]*ArcTan[(e + 2*f*x)/Sqrt[
-e^2 + 4*d*f]]*Log[c*(a + b*x)^n]^2 - Sqrt[-e^2 + 4*d*f]*n^2*Log[a + b*x]^2*Log[1 - (2*f*(a + b*x))/(-(b*e) +
2*a*f + b*Sqrt[e^2 - 4*d*f])] + 2*Sqrt[-e^2 + 4*d*f]*n*Log[a + b*x]*Log[c*(a + b*x)^n]*Log[1 - (2*f*(a + b*x))
/(-(b*e) + 2*a*f + b*Sqrt[e^2 - 4*d*f])] + Sqrt[-e^2 + 4*d*f]*n^2*Log[a + b*x]^2*Log[1 + (2*f*(a + b*x))/(-2*a
*f + b*(e + Sqrt[e^2 - 4*d*f]))] - 2*Sqrt[-e^2 + 4*d*f]*n*Log[a + b*x]*Log[c*(a + b*x)^n]*Log[1 + (2*f*(a + b*
x))/(-2*a*f + b*(e + Sqrt[e^2 - 4*d*f]))] + 2*Sqrt[-e^2 + 4*d*f]*n*Log[c*(a + b*x)^n]*PolyLog[2, (2*f*(a + b*x
))/(2*a*f + b*(-e + Sqrt[e^2 - 4*d*f]))] - 2*Sqrt[-e^2 + 4*d*f]*n*Log[c*(a + b*x)^n]*PolyLog[2, (2*f*(a + b*x)
)/(2*a*f - b*(e + Sqrt[e^2 - 4*d*f]))] - 2*Sqrt[-e^2 + 4*d*f]*n^2*PolyLog[3, (2*f*(a + b*x))/(-(b*e) + 2*a*f +
 b*Sqrt[e^2 - 4*d*f])] + 2*Sqrt[-e^2 + 4*d*f]*n^2*PolyLog[3, (2*f*(a + b*x))/(2*a*f - b*(e + Sqrt[e^2 - 4*d*f]
))])/Sqrt[-(e^2 - 4*d*f)^2]

________________________________________________________________________________________

Maple [F]  time = 9.795, size = 0, normalized size = 0. \begin{align*} \int{\frac{ \left ( \ln \left ( c \left ( bx+a \right ) ^{n} \right ) \right ) ^{2}}{f{x}^{2}+ex+d}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(ln(c*(b*x+a)^n)^2/(f*x^2+e*x+d),x)

[Out]

int(ln(c*(b*x+a)^n)^2/(f*x^2+e*x+d),x)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(c*(b*x+a)^n)^2/(f*x^2+e*x+d),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{\log \left ({\left (b x + a\right )}^{n} c\right )^{2}}{f x^{2} + e x + d}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(c*(b*x+a)^n)^2/(f*x^2+e*x+d),x, algorithm="fricas")

[Out]

integral(log((b*x + a)^n*c)^2/(f*x^2 + e*x + d), x)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\log{\left (c \left (a + b x\right )^{n} \right )}^{2}}{d + e x + f x^{2}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(ln(c*(b*x+a)**n)**2/(f*x**2+e*x+d),x)

[Out]

Integral(log(c*(a + b*x)**n)**2/(d + e*x + f*x**2), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\log \left ({\left (b x + a\right )}^{n} c\right )^{2}}{f x^{2} + e x + d}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(c*(b*x+a)^n)^2/(f*x^2+e*x+d),x, algorithm="giac")

[Out]

integrate(log((b*x + a)^n*c)^2/(f*x^2 + e*x + d), x)